<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:t="https://code.google.com/p/rad-framework/taglib"
	xmlns:tt="https://code.google.com/p/rad-framework"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
		<title>#{messages['titlebar.text']}</title>
		<link href="#{contextPath}/themes/default/css/global.css" rel="stylesheet"
			type="text/css"/>
		<link
			href="#{contextPath}/themes/default/images/favicon.ico"
			rel="shortcut icon" />

		<script type="text/javascript">
			function clickClear(thisfield, defaulttext) {
			    if (thisfield.value == defaulttext) {
	                thisfield.value = "";
			    }
			}
			function clickRecall(thisfield, defaulttext) {
				if (thisfield.value == '') {
					thisfield.value = defaulttext;
				}
			}
		</script>
	</head>
	<body class="rad-framework-body">
		
		<div id="rad-framework-container">
			<div id="rad-framework-sizer">
				<div id="rad-framework-logo"></div>
				<s:div id="rad-framework-welcome" rendered="#{identity.loggedIn}">
					<h:outputText value="#{messages['Welcome']}, "/>
					<strong>
						<h:outputText value="#{identity.credentials.username}"/>
					</strong>
				</s:div>
				<div id="rad-framework-utilities">
					<h:form rendered="#{not identity.loggedIn}">
						<h:outputLabel styleClass="rad-framework-login-label" value="#{messages['Username']}: "/>
						<h:inputText styleClass="rad-framework-form-input-field" id="loginUsername" value="#{identity.username}" size="10"/>
						<h:outputLabel styleClass="rad-framework-login-label" value="#{messages['Password']}: "/>
						<h:inputSecret styleClass="rad-framework-form-input-field" id="loginPassword" value="#{identity.password}" size="10" />
						<h:commandLink value="#{messages['Login']}" action="#{identity.login}"/>
						&nbsp;<h:outputText value=" | "/>&nbsp;
						<h:commandLink value="#{messages['Register']}" action="register"/>
					</h:form>

					<h:form id="navForm" rendered="#{identity.loggedIn}">
						<h:commandLink value="#{messages['Logout']}" action="#{identity.logout}"/>
						&nbsp;<h:outputText value=" | "/>&nbsp;
						<h:outputLink value="/jsf/User/Profile.seam">#{messages['Profile']}</h:outputLink>
					</h:form>
				</div>
				<s:div rendered="#{identity.loggedIn}">
					<div id="rad-framework-menu">
						<ui:insert name="menu">
							<h:form id="menuForm">
								<rich:toolBar id="toolbar">
									<ui:include src="/themes/default/includes/menus.xhtml"/>
								</rich:toolBar>
							</h:form>
						</ui:insert>
					</div>
				</s:div>
			</div>
			
			<div id="rad-framework-title">
				<h:panelGrid>
					<h:outputText value="#{title}"/>
				</h:panelGrid>
			</div>
			<div id="rad-framework-crumbs">
				<h:panelGrid>
					<ui:insert name="crumbs"> Crumbs!!! </ui:insert>
				</h:panelGrid>
			</div>
			
			
			<div id="rad-framework-search">
				<ui:insert name="search">
					<h:form id="quickSearchForm">
						<h:inputText id="quickSearchText"
							value="#{searchAction.searchPattern}"
							onclick="clickClear(this, 'Quick Search...')"
							onblur="clickRecall(this, 'Quick Search...')"
							styleClass="rad-framework-quick-search" size="15"
							maxlength="1000">
						</h:inputText>
						<rich:spacer width="3"/>
						<h:commandLink id="findLink" value="#{messages['Find']}" action="/jsf/search.xhtml">
							<f:param name="currentPage" value="1" />
							<s:defaultAction />
						</h:commandLink>
					</h:form>
				</ui:insert>
			</div>

			<ui:insert name="messages">
				<a4j:outputPanel ajaxRendered="true">
					<s:div styleClass="rad-framework-messages" rendered="#{!empty facesMessages.currentGlobalMessages}">
						<s:div styleClass="rad-framework-messages-content">
							<h:form>
								<div class="rad-framework-messages-close-button">
									<a4j:commandLink reRender="rad-framework-messages">
										<h:graphicImage value="/themes/default/images/icons/ico-sprite-close.png" /> 
									</a4j:commandLink>
								</div>
							</h:form>
							<h:messages errorClass="rad-framework-msg-error"
								infoClass="rad-framework-msg-info"
								warnClass="rad-framework-msg-alert" globalOnly="true" />
						</s:div>
					</s:div>
				</a4j:outputPanel>
			</ui:insert>
			
			<ui:insert name="body">
				<div id="rad-framework-content-left">
					<ui:insert name="left"> Sidebar!!! </ui:insert>
				</div>
				<div id="rad-framework-content-container">
					<ui:insert name="center"> Welcome!!! </ui:insert>
				</div>
			</ui:insert>
		</div>
		
		<div id="ajax-status">
			<a4j:status>
				<f:facet name="start">
					<h:graphicImage value="#{messages['StatusIcon']}"/>
				</f:facet>
			</a4j:status>
		</div>
		
	</body>
</html>